import Taro, { Config } from "@tarojs/taro";
import { View, Image } from "@tarojs/components";
import "./index.scss";
import { waterFallData } from "./api";

export const ProjectPage = () => {
  const previewImages = waterFallData.map(item => item.pic);

  return (
    <View className="project-page">
      {waterFallData.map((item, index) => (
        <View key={index} className="wrap">
          <Image
            src={item.pic}
            mode="widthFix"
            onClick={() => {
              Taro.previewImage({
                current: item.pic, // 当前显示图片的http链接
                urls: previewImages
              });
            }}
            style={{
              width: "100%",
              borderTopLeftRadius: "12rpx",
              borderTopRightRadius: "12rpx"
            }}
          />
          {/* <View className="text">{item.text}</View> */}
        </View>
      ))}
      {/* <View className="no-data">
        <Image src={NoVotePic} mode="widthFix" style={{ width: "80%" }} />
        <View>投票暂未开启，敬请期待</View>
      </View> */}
    </View>
  );
};

ProjectPage.config = {
  navigationBarTitleText: ""
} as Config;
